package com.whu.helpluojia.controller;

import com.whu.helpluojia.common.R;
import com.whu.helpluojia.domain.Bagman;
import com.whu.helpluojia.service.BagManService;
import com.whu.helpluojia.service.BagManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/bagman")
public class BagmanController {

    @Autowired
    private BagManService bagmanService;

    @PostMapping
    private void addBagman(@RequestBody Bagman bagman){
        bagmanService.addBagman(bagman);
        System.out.println("bagman:"+bagman);

    }

    @GetMapping("/{id}")
    private Bagman getBagmanById(@PathVariable Long id){
        Bagman bagman = bagmanService.queryBagmanById(id);
        return bagman;
    }
}
